﻿@inject Microsoft.AspNetCore.Http.IHttpContextAccessor _httpContextAccessor
@{
    var isLogin = _httpContextAccessor.HttpContext?.User?.Identity.IsAuthenticated ?? false;
}

<header class="header body-content">
    <nav class="navbar navbar-default header-navigation">
        <a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index" style="margin-top:5px;">
            <img src="~/icons/identity.png" style="float: left; height: 32px; margin-top: -5px;padding-right:5px;">统一认证与授权中心
        </a>

        <ul class="nav navbar-nav navbar-right user-info">
            @if (isLogin)
            {
                <li class="nav-item">
                    <a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Profile">[@_httpContextAccessor.HttpContext.User.Identity.Name]</a>
                </li>
            }
            else
            {
                <li class="nav-item">
                    <a class="nav-link text-dark" asp-area="" asp-controller="Account" asp-action="Login">[ 登陆 ]</a>
                </li>
            }

            <li class="nav-item">
                <a class="nav-link text-dark" href="#" onclick="Account.onLogout(this)">[ 注销 ]</a>
            </li>
        </ul>

        <ul class="nav nav-pills user-menu" style="margin-top:6px;">
            @*<li class="nav-item">
            <a class="nav-link text-dark" asp-area="" asp-controller="Admin" asp-action="User">用户管理</a>
            </li>
            <li class="nav-item">
            <a class="nav-link text-dark" asp-area="" asp-controller="Admin" asp-action="Group">组织单位管理</a>
            </li>
            <li class="nav-item">
            <a class="nav-link text-dark" asp-area="" asp-controller="Admin" asp-action="Level">级别管理</a>
            </li>
            <li class="nav-item">
            <a class="nav-link text-dark" asp-area="" asp-controller="Admin" asp-action="Role">角色管理</a>
            </li>
            <li class="nav-item">
            <a class="nav-link text-dark" asp-area="" asp-controller="Admin" asp-action="UserRole">用户角色管理</a>
            </li>
            <li class="nav-item">
            <a class="nav-link text-dark" asp-area="" asp-controller="Admin" asp-action="UserGroup">用户组管理</a>
            </li>
            <li class="nav-item">
            <a class="nav-link text-dark" asp-area="" asp-controller="Admin" asp-action="Resource">资源管理</a>
            </li>
            <li class="nav-item">
            <a class="nav-link text-dark" asp-area="" asp-controller="Admin" asp-action="AccessRule">访问规则管理</a>
            </li>
            <li class="nav-item">
            <a class="nav-link text-dark" asp-area="" asp-controller="Admin" asp-action="UserResource">用户可访问资源查询</a>
            </li>
            <li class="nav-item">
            <a class="nav-link text-dark" asp-area="" asp-controller="Admin" asp-action="Parameter">基础数据</a>
            </li>*@
        </ul>
    </nav>
</header>